'use strict';

module.exports = app => {
  const { INTEGER, STRING, DATE, NOW, TEXT } = app.Sequelize;
  const Role = app.model.define('role', {
    role_id: {
      type: STRING,
      primaryKey: true,
      unique: true,
    },
    role_name: STRING,
    describe: STRING,
    status: {
      type: INTEGER,
      defaultValue: 1,
    },
    creator_id: STRING,
    create_at: {
      type: DATE,
      defaultValue: NOW,
    },
    deleted: {
      type: STRING,
      defaultValue: 0,
    },
    permissions: TEXT,
  }, {
    timestamps: false,
    tableName: 'l_role',
  })

  return Role;
}
